<?php
class Project {

    private $mId;
    private $mName;
    private $mDescription;
    private $mStartDate;
    private $mDueDate;
    private $mStatus;
    private $mCreatedBy;
    private $mCreatedAt;
    private $mUpdatedBy;
    private $mUpdatedAt;
    private $mProjectAssignment;
    private $mTasks;
    
    public function getId() {
        return $this->mId;
    }

    public function setId($value) {
        $this->mId = $value;
    }

    public function getName() {
        return $this->mName;
    }

    public function setName($value) {
        $this->mName = $value;
    }

    public function getDescription() {
        return $this->mDescription;
    }

    public function setDescription($value) {
        $this->mDescription = $value;
    }

    public function getStartDate() {
        return $this->mStartDate;
    }

    public function setStartDate($value) {
        $this->mStartDate = $value;
    }

    public function getDueDate() {
        return $this->mDueDate;
    }

    public function setDueDate($value) {
        $this->mDueDate = $value;
    }

    public function getStatus() {
        return $this->mStatus;
    }

    public function setStatus($value) {
        $this->mStatus = $value;
    }
    
    public function getCreatedBy() {
        if(($this->mCreatedBy != null)&&(!$this->mCreatedBy->IsLoaded())){
            $userDao = new UserDao();
            $this->mCreatedBy = $userDao->getObject($this->mCreatedBy->getId());
            if ($this->mCreatedBy != null) $this->mCreatedBy->setIsLoaded(true);
        }
        return $this->mCreatedBy;
    }

    public function setCreatedBy($value) {
        $this->mCreatedBy = $value;
    }
    
    public function getCreatedDate() {
        return $this->mCreatedAt;
    }

    public function setCreatedDate($value) {
        $this->mCreatedAt = $value;
    }
	
    public function getUpdatedBy() {
        if(($this->mUpdatedBy != null)&&(!$this->mUpdatedBy->IsLoaded())){
            $userDao = new UserDao();
            $this->mUpdatedBy = $userDao->getObject($this->mUpdatedBy->getId());
            if ($this->mUpdatedBy != null) $this->mUpdatedBy->setIsLoaded(true);
        }
        return $this->mUpdatedBy;
    }

    public function setUpdatedBy($value) {
        $this->mUpdatedBy = $value;
    }
    
    public function getUpdatedDate() {
        return $this->mUpdatedAt;
    }

    public function setUpdatedDate($value) {
        $this->mUpdatedAt = $value;
    }
    
    public function getProjectAssignment(){
        if (($this->mProjectAssignment == null)) {
            $ProjectAssignmentDao = new ProjectAssignmentDao();
            $this->mProjectAssignment = $ProjectAssignmentDao->getListByProjectId($this->mId);
            }
        return $this->mProjectAssignment;
    }
	
    public function setProjectAssignment($value){
        $this->mProjectAssignment = $value;
    }
    
    public function getTasks(){
        if (($this->mTasks == null)) {
            $TaskDao = new TaskDao();
            $this->mTasks = $TaskDao->getListByProjectId($this->mId);
            }
        return $this->mTasks;
    }
	
    public function setTasks($value){
        $this->mTasks = $value;
    }
    
    public function IsLoaded() {
        return $this->mIsLoaded;
    }

    public function setIsLoaded($value) {
        $this->mIsLoaded = $value;
    }
    
}
